package com.hongtech.modules.knowledge.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hongtech.common.service.impl.CrudServiceImpl;
import com.hongtech.common.util.BeanCopierUtils;
import com.hongtech.modules.knowledge.mapper.FirstAidTypeMapper;
import com.hongtech.modules.knowledge.dto.FirstAidTypeDTO;
import com.hongtech.modules.knowledge.entity.FirstAidTypeEntity;
import com.hongtech.modules.knowledge.service.FirstAidTypeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 急救类型表
 *
 * @author admin 123456789@qq.com
 * @since 1.0.0 2023-09-01
 */
@Service
public class FirstAidTypeServiceImpl extends CrudServiceImpl<FirstAidTypeMapper, FirstAidTypeEntity, FirstAidTypeDTO> implements FirstAidTypeService {

    @Override
    public List<FirstAidTypeDTO> listFirstAidType() {
        LambdaQueryWrapper<FirstAidTypeEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.orderByAsc(FirstAidTypeEntity::getOrderNumber);
        List<FirstAidTypeEntity> list = baseDao.selectList(queryWrapper);
        return BeanCopierUtils.copyPropertiesList(list, FirstAidTypeDTO.class);
    }

}
